function mxCell(value, geometry, style)
{
	this.value = value;
	this.setGeometry(geometry);
	this.setStyle(style);

	if (this.onInit != null)
	{
		this.onInit();
	}
};
mxCell.prototype.id = null;
mxCell.prototype.value = null;
mxCell.prototype.geometry = null;
mxCell.prototype.style = null;
mxCell.prototype.vertex = false;
mxCell.prototype.edge = false;
mxCell.prototype.connectable = true;
mxCell.prototype.visible = true;
mxCell.prototype.collapsed = false;
mxCell.prototype.parent = null;
mxCell.prototype.source = null;
mxCell.prototype.target = null;
mxCell.prototype.children = null;
mxCell.prototype.edges = null;
mxCell.prototype.mxTransient = ['id', 'value', 'parent', 'source', 'target', 'children', 'edges'];
mxCell.prototype.getId = function()
{
	return this.id;
};
mxCell.prototype.setId = function(id)
{
	this.id = id;
};
mxCell.prototype.getValue = function()
{
	return this.value;
};
mxCell.prototype.setValue = function(value)
{
	this.value = value;
};
mxCell.prototype.valueChanged = function(newValue)
{
	var previous = this.getValue();
	this.setValue(newValue);
	return previous;
};
mxCell.prototype.getGeometry = function()
{
	return this.geometry;
};
mxCell.prototype.setGeometry = function(geometry)
{
	this.geometry = geometry;
};
mxCell.prototype.getStyle = function()
{
	return this.style;
};
mxCell.prototype.setStyle = function(style)
{
	this.style = style;
};
mxCell.prototype.isVertex = function()
{
	return this.vertex;
};
mxCell.prototype.setVertex = function(vertex)
{
	this.vertex = vertex;
};
mxCell.prototype.isEdge = function()
{
	return this.edge;
};
mxCell.prototype.setEdge = function(edge)
{
	this.edge = edge;
};
mxCell.prototype.isConnectable = function()
{
	return this.connectable;
};
mxCell.prototype.setConnectable = function(connectable)
{
	this.connectable = connectable;
};
mxCell.prototype.isVisible = function()
{
	return this.visible;
};
mxCell.prototype.setVisible = function(visible)
{
	this.visible = visible;
};
mxCell.prototype.isCollapsed = function()
{
	return this.collapsed;
};
mxCell.prototype.setCollapsed = function(collapsed)
{
	this.collapsed = collapsed;
};
mxCell.prototype.getParent = function(parent)
{
	return this.parent;
};
mxCell.prototype.setParent = function(parent)
{
	this.parent = parent;
};
mxCell.prototype.getTerminal = function(source)
{
	return (source) ? this.source : this.target;
};
mxCell.prototype.setTerminal = function(terminal, isSource)
{
	if (isSource)
	{
		this.source = terminal;
	}
	else
	{
		this.target = terminal;
	}
	return terminal;
};
mxCell.prototype.getChildCount = function()
{
	return (this.children == null) ? 0 : this.children.length;
};
mxCell.prototype.getIndex = function(child)
{
	return mxUtils.indexOf(this.children, child);
};
mxCell.prototype.getChildAt = function(index)
{
	return (this.children == null) ? null : this.children[index];
};
mxCell.prototype.insert = function(child, index)
{
	if (child != null)
	{
		index = (index != null) ? index : this.getChildCount();
		child.removeFromParent();
		child.setParent(this);

		if (this.children == null)
		{
			this.children = [];
			this.children.push(child);
		}
		else
		{
			this.children.splice(index, 0, child);
		}
	}
	return child;
};
mxCell.prototype.remove = function(index)
{
	var child = null;

	if (this.children != null && index >= 0)
	{
		child = this.getChildAt(index);

		if (child != null)
		{
			this.children.splice(index, 1);
			child.setParent(null);
		}
	}
	return child;
};
mxCell.prototype.removeFromParent = function()
{
	if (this.parent != null)
	{
		var index = this.parent.getIndex(this);
		this.parent.remove(index);
	}
};
mxCell.prototype.getEdgeCount = function()
{
	return (this.edges == null) ? 0 : this.edges.length;
};
mxCell.prototype.getEdgeIndex = function(edge)
{
	return mxUtils.indexOf(this.edges, edge);
};
mxCell.prototype.getEdgeAt = function(index)
{
	return (this.edges == null) ? null : this.edges[index];
};
mxCell.prototype.insertEdge = function(edge, isOutgoing)
{
	if (edge != null)
	{
		edge.removeFromTerminal(isOutgoing);
		edge.setTerminal(this, isOutgoing);

		if (this.edges == null || edge.getTerminal(!isOutgoing) != this || mxUtils.indexOf(this.edges, edge) < 0)
		{
			if (this.edges == null)
			{
				this.edges = [];
			}
			this.edges.push(edge);
		}
	}
	return edge;
};
mxCell.prototype.removeEdge = function(edge, isOutgoing)
{
	if (edge != null)
	{
		if (edge.getTerminal(!isOutgoing) != this && this.edges != null)
		{
			var index = this.getEdgeIndex(edge);

			if (index >= 0)
			{
				this.edges.splice(index, 1);
			}
		}
		edge.setTerminal(null, isOutgoing);
	}
	return edge;
};
mxCell.prototype.removeFromTerminal = function(isSource)
{
	var terminal = this.getTerminal(isSource);

	if (terminal != null)
	{
		terminal.removeEdge(this, isSource);
	}
};
mxCell.prototype.getAttribute = function(name, defaultValue)
{
	var userObject = this.getValue();
	var val = (userObject != null && userObject.nodeType == mxConstants.NODETYPE_ELEMENT)
		? userObject.getAttribute(name) : null;
	return val || defaultValue;
};
mxCell.prototype.setAttribute = function(name, value)
{
	var userObject = this.getValue();

	if (userObject != null && userObject.nodeType == mxConstants.NODETYPE_ELEMENT)
	{
		userObject.setAttribute(name, value);
	}
};
mxCell.prototype.clone = function()
{
	var clone = mxUtils.clone(this, this.mxTransient);
	clone.setValue(this.cloneValue());
	return clone;
};
mxCell.prototype.cloneValue = function()
{
	var value = this.getValue();

	if (value != null)
	{
		if (typeof (value.clone) == 'function')
		{
			value = value.clone();
		}
		else if (!isNaN(value.nodeType))
		{
			value = value.cloneNode(true);
		}
	}
	return value;
};